package com.k2data.k2app.common;

import com.k2data.app.kmx.KmxInitParams;
import com.k2data.app.kmx.enums.KmxCondType;
import com.k2data.app.kmx.enums.KmxRestVersion;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author lidong9144@163.com 17-5-3.
 */
@Component
public class KmxParams {

    @Getter
    private KmxInitParams kmxInitParams;

    @Autowired
    public KmxParams(MyConstant myConstant) {
        kmxInitParams = new KmxInitParams(KmxRestVersion.V040)
                .setIdField(MyConstant.KMX_ID_FIELD_MACHINE_NAME)
                .addUrl(KmxCondType.fieldGroups, myConstant.getFieldGroupsUrl())
                .addUrl(KmxCondType.postData, myConstant.getPostDataUrl())
                .addUrl(KmxCondType.assets, myConstant.getAssetsUrl())
                .addUrl(KmxCondType.dataRows, myConstant.getDataRowsUrl())
                .addUrl(KmxCondType.dataPoints, myConstant.getDataPointsUrl())
                .addUrl(KmxCondType.dataStreams, myConstant.getDataStreamsUrl())
                .addUrl(KmxCondType.streamRules, myConstant.getStreamRuleUrl());
    }

}
